﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Models;
using System.Models.Models;
using System.Text;
using System.Threading.Tasks;

namespace System.DataInitialization.ModelsData
{
    public class MenusData
    {
        private MyDbContext db;
        private List<Menus> listMenus;

        public MenusData()
        {
            db = new MyDbContext();
            listMenus = new List<Menus>();

            #region 父菜单
            Menus menus = new Menus()
            {
                Title = "社区管理",
                Icon = "fa fa-institution",
                Href = "",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(menus);

            Menus menus1 = new Menus()
            {
                Title = "人员管理",
                Icon = "fa fa-institution",
                Href = "",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(menus1);

            Menus menus2 = new Menus()
            {
                Title = "互动管理",
                Icon = "fa fa-institution",
                Href = "",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(menus2);

            Menus menus3 = new Menus()
            {
                Title = "报修维护管理",
                Icon = "fa fa-institution",
                Href = "",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(menus3);

            Menus menus4 = new Menus()
            {
                Title = "停车场管理",
                Icon = "fa fa-institution",
                Href = "",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(menus4);

            Menus menus5 = new Menus()
            {
                Title = "监控管理",
                Icon = "fa fa-institution",
                Href = "",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(menus5);

            Menus menus6 = new Menus()
            {
                Title = "收费管理",
                Icon = "fa fa-institution",
                Href = "",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(menus6);

            Menus menus7 = new Menus()
            {
                Title = "系统管理",
                Icon = "fa fa-institution",
                Href = "",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(menus7);
            #endregion

            //以下是子菜单
            #region 社区管理子菜单 pid=1
            Menus childMenus = new Menus()
            {
                Pid = 1,
                Title = "公示信息管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus);

            Menus childMenus1 = new Menus()
            {
                Pid = 1,
                Title = "社区房屋管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus1);

            Menus childMenus2 = new Menus()
            {
                Pid = 1,
                Title = "社区物资管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus2);
            #endregion

            #region 人员管理子菜单 pid=2

            Menus childMenus3 = new Menus()
            {
                Pid = 2,
                Title = "用户管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus3);
            
            Menus childMenus4 = new Menus()
            {
                Pid = 2,
                Title = "临时进出管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus4);

            #endregion

            #region 互动管理 pid=3
            Menus childMenus5 = new Menus()
            {
                Pid = 3,
                Title = "活动管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus5);

            Menus childMenus6 = new Menus()
            {
                Pid = 3,
                Title = "在线调查管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus6);

            Menus childMenus7 = new Menus()
            {
                Pid = 3,
                Title = "留言管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus7);
            #endregion

            #region 报修维护管理子菜单pid = 4
            Menus childMenus8 = new Menus()
            {
                Pid = 4,
                Title = "报修信息管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus8);

            #endregion

            #region 停车场管理 pid=5
            Menus childMenus9 = new Menus()
            {
                Pid = 5,
                Title = "车位信息管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus9);

            Menus childMenus10 = new Menus()
            {
                Pid = 5,
                Title = "招租信息管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus10);

            Menus childMenus11 = new Menus()
            {
                Pid = 5,
                Title = "销售信息管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus11);
            #endregion

            #region 监控管理 pid=6
            Menus childMenus12 = new Menus()
            {
                Pid = 6,
                Title = "实时监控大屏",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus12);

            Menus childMenus13 = new Menus()
            {
                Pid = 6,
                Title = "监控信息管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus13);

            Menus childMenus14 = new Menus()
            {
                Pid = 6,
                Title = "监控设备管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus14);
            #endregion

            #region 收费管理 pid=7
            Menus childMenus15 = new Menus()
            {
                Pid = 7,
                Title = "水电燃油费用管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus15);

            Menus childMenus16 = new Menus()
            {
                Pid = 7,
                Title = "物管费用管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus16);

            Menus childMenus17 = new Menus()
            {
                Pid = 7,
                Title = "停车费管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus17);
            #endregion

            #region 系统管理 pid=8
            Menus childMenus18 = new Menus()
            {
                Pid = 8,
                Title = "菜单管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus18);

            Menus childMenus19 = new Menus()
            {
                Pid = 8,
                Title = "员工管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus19);

            Menus childMenus20 = new Menus()
            {
                Pid = 8,
                Title = "角色管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus20);

            Menus childMenus21 = new Menus()
            {
                Pid = 8,
                Title = "权限管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus21);

            Menus childMenus22 = new Menus()
            {
                Pid = 8,
                Title = "日志管理",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus22);

            Menus childMenus23 = new Menus()
            {
                Pid = 8,
                Title = "系统设置",
                Icon = "fa fa-institution",
                Href = "#",
                Target = "_self",
                Sort = 0,
                Status = true,
                Remark = "物业管理的菜单"
            };
            listMenus.Add(childMenus23);
            #endregion
        }

        public void AddData()
        {
            foreach (var list in listMenus)
            {
                // 检查数据准确性
                /*Console.WriteLine(list.Pid + list.Title + list.Href);*/

                db.Menuss.Add(list);
            }
            db.SaveChanges();
            Console.WriteLine("菜单表数据初始化成功");


        }
    }
}
